define(function(require, exports, module){
	var eventdetailsTemp = require("text!../template/eventdetails.html");
	
	module.exports = Nuui.View.extend({
		
		template:eventdetailsTemp,
		
		onRender:function(){
			var view = this;
			var details=App.storage.get("activeDetail");
			App.request(App.server.getServePath(App.path.cloudlectureAction), {
				success:function(data){
					if(data.ec){
						alert(data.em);
					}else{
						var list=data.cloudList[details];
						var tpl='<div class="event-banner">\n' +
                            '        <img src="images/img/'+list.img+'" alt="" />\n' +
                            '    </div>\n' +
                            '    <section class="event-section">\n' +
                            '        <div class="evet-detail">\n' +
                            '            <div class="detail-top">\n' +
                            '                <h3>'+list.title+'</h3>\n' +
                            '            </div>\n' +
                            '            <div class="detail-mibble">\n' +
                            '                <ul class="toMap">\n' +
                            '                    <li style="padding-top: .1rem;">'+list.address+'</li>\n' +
                            '                    <li><img src="images/img/dibiao.png" alt="" /></li>\n' +
                            '                    <li style="padding-top: .1rem;"><a href="##"><img src="images/img/dayu.png"/></a></li>\n' +
                            '                </ul>\n' +
                            '            </div>\n' +
                            '            <p class="detail-p1">'+list.data+list.time+'--'+list.oldData+list.oldTime+' <em><img src="images/img/shijian.png" alt="" /></em></p>\n' +
                            '            <p class="detail-p2"><span>'+list.person+'</span>人参与<em>'+list.over+'</em></p>\n' +
                            '            <a href="##">'+list.alliance+'</a>\n' +
                            '            <a href="##">'+list.iot+'</a>\n' +
                            '            <a href="##">'+list.cost+'</a>\n' +
                            '        </div>\n' +
                            '    </section>';
						var tpl1=' <section class="event-section">\n' +
                            '        <div class="evet-detail">\n' +
                            '            <div class="detail-top convention">\n' +
                            '                <h3>大会亮点</h3>\n' +
                            '            </div>\n' +
                            '            <ul class="convention-list">\n' +
                            '                <li><span>'+list.convention.allPerson+'<br/>人</span><a href="javascript:void(0)">参会规模</a></li>\n' +
                            '                <li><span>'+list.convention.timeUse+'<br/>天</span><a href="javascript:void(0)">参会时间</a></li>\n' +
                            '                <li><span>'+list.convention.expertsNumber+'<br/>人</span><a href="javascript:void(0)">行业专家</a></li>\n' +
                            '                <li><span>'+list.convention.currentTheme+'<br/>个</span><a href="javascript:void(0)">时事主题</a></li>\n' +
                            '            </ul>\n' +
                            '        </div>\n' +
                            '    </section>';

                        view.$(".event-detail .convention-info").html(tpl);
                        //view.$(".event-detail .convention-list").html(tpl1);

						view.$(".event-detail").on("tap",".toMap", function(){
                            var address=$(this).children("li").get(0).innerText;
                           	App.storage.set("address",address);
                            App.navigate("example/index/map", true);
                            return false;
						});

					  }
				  }
			 });
		},
		
		onShow:function(){
			 
		}
		
	});	
});